package com.ruoyi.OutboundManagement.service.impl;

import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.OutboundManagement.mapper.SalesOutboundMapper;
import com.ruoyi.OutboundManagement.domain.SalesOutbound;
import com.ruoyi.OutboundManagement.service.ISalesOutboundService;

/**
 * 销售出库管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-07-04
 */
@Service
public class SalesOutboundServiceImpl implements ISalesOutboundService 
{
    @Autowired
    private SalesOutboundMapper salesOutboundMapper;

    /**
     * 查询销售出库管理
     * 
     * @param outboundId 销售出库管理主键
     * @return 销售出库管理
     */
    @Override
    public SalesOutbound selectSalesOutboundByOutboundId(Long outboundId)
    {
        return salesOutboundMapper.selectSalesOutboundByOutboundId(outboundId);
    }

    /**
     * 查询销售出库管理列表
     * 
     * @param salesOutbound 销售出库管理
     * @return 销售出库管理
     */
    @Override
    public List<SalesOutbound> selectSalesOutboundList(SalesOutbound salesOutbound)
    {
        return salesOutboundMapper.selectSalesOutboundList(salesOutbound);
    }

    /**
     * 新增销售出库管理
     * 
     * @param salesOutbound 销售出库管理
     * @return 结果
     */
    @Override
    public int insertSalesOutbound(SalesOutbound salesOutbound)
    {
        salesOutbound.setCreatedAt(new Date());
        return salesOutboundMapper.insertSalesOutbound(salesOutbound);
    }

    /**
     * 修改销售出库管理
     * 
     * @param salesOutbound 销售出库管理
     * @return 结果
     */
    @Override
    public int updateSalesOutbound(SalesOutbound salesOutbound)
    {
        return salesOutboundMapper.updateSalesOutbound(salesOutbound);
    }

    /**
     * 批量删除销售出库管理
     * 
     * @param outboundIds 需要删除的销售出库管理主键
     * @return 结果
     */
    @Override
    public int deleteSalesOutboundByOutboundIds(Long[] outboundIds)
    {
        return salesOutboundMapper.deleteSalesOutboundByOutboundIds(outboundIds);
    }

    /**
     * 删除销售出库管理信息
     * 
     * @param outboundId 销售出库管理主键
     * @return 结果
     */
    @Override
    public int deleteSalesOutboundByOutboundId(Long outboundId)
    {
        return salesOutboundMapper.deleteSalesOutboundByOutboundId(outboundId);
    }
}
